package cc.yugu.yhdw.common.domain.basic;
/**
 * 订单id常量类
 *
 * @Date:Created in 2018/6/26 19:05
 * @Author:
 * @Modified By: zxj 2018/6/26 19:05
 */
public class OrderId {

    public static String PREFIX_ORDER_ID = "AA";

    public final static String PREFIX_ITEM_ORDER = "CT";
    public final static String PREFIX_EX_ORDER = "CT";
    public final static String PREFIX_CHARGER = "CT";
    public final static String PREFIX_DEPOSIT = "DD";
    public final static String PREFIX_ALIPAY_PAY = "AP";
    public final static String PREFIX_WEIXIN_PAY = "WP";
    public final static String EXCHANGE_PACKT = "EP";
    public final static String CUSTOMER_FORGIFT_ORDER = "CF";

    public enum OrderIdType {
        ITEM(1, "商品"),
        EXCHANGE(2, "换电"),
        CHARGE(3, "充电"),
        DEPOSIT(4, "充值"),
        ALIPAY_PAY(5, "支付宝订单"),
        WEIXIN_PAY(6, "微信订单"),
        EXCHANGE_PACKT(7, "换电套餐订单"),
        CUSTOMER_FORGIFT_ORDER(8, "客户押金订单");

        private final int value;
        private final String name;

        private OrderIdType(int value, String name) {
            this.value = value;
            this.name = name;
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    public final static String DATE_FORMAT = "yy";
    public final static int NUMBER_LENGTH = 12;
    public final static String NUMBER_FORMAT = "%0" + NUMBER_LENGTH + "d";

    public final static String PAY_ORDER_DATE_FORMAT = "yyyyMMdd";
    public final static int PAY_ORDER_NUMBER_LENGTH = 20;
    public final static String PAY_ORDER_NUMBER_FORMAT = "%0" + PAY_ORDER_NUMBER_LENGTH + "d";

    public OrderId() {
    }

    public OrderId(OrderIdType type, Integer suffix) {
        this.orderType = type.getValue();
        this.suffix = suffix;
    }

    Integer id;
    Integer orderType;
    Integer suffix;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getOrderType() {
        return orderType;
    }

    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }

    public Integer getSuffix() {
        return suffix;
    }

    public void setSuffix(Integer suffix) {
        this.suffix = suffix;
    }
}
